import torch
import numpy as np

# 打印张量
def printTensor(tensor):
    torch.set_printoptions(threshold=np.inf)
    tensor = tensor.detach().cpu()
    with open('tensor.txt', 'w') as f:
        f.write(str(tensor))
